//
//  Contecter.m
//  17-homework-addressBook
//
//  Created by 王道林 on 16/8/8.
//  Copyright © 2016年 王道林. All rights reserved.
//

#import "Contecter.h"

@implementation Contecter

- (instancetype)initWithName:(NSString *)name PicName:(NSString *)picName phoneNumber:(NSString *)phoneNumber homePlace:(NSString *)homePlace{
    
    self = [super init];
    if (self) {
        _name = name;
        _picName = picName;
        _homePlace = homePlace;
        _phoneNumber = phoneNumber;
    }
    return self;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    
}

// 反归档

- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
    self = [super init];
    if (self) {
        _name = [aDecoder decodeObjectForKey:@"name"];
        _picName = [aDecoder decodeObjectForKey:@"picName"];
        _phoneNumber = [aDecoder decodeObjectForKey:@"phoneNumber"];
        _age = [aDecoder decodeObjectForKey:@"age"];
        _gender = [aDecoder decodeObjectForKey:@"gender"];
        _homePlace = [aDecoder decodeObjectForKey:@"homePlace"];
    }
    return self;
}

- (void)encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeObject:_name forKey:@"name"];
    [aCoder encodeObject:_picName forKey:@"picName"];
    [aCoder encodeObject:_phoneNumber forKey:@"phoneNumber"];
    [aCoder encodeObject:_age forKey:@"age"];
    [aCoder encodeObject:_gender forKey:@"gender"];
    [aCoder encodeObject:_homePlace forKey:@"homePlace"];
}




@end
